      
	One-dimensional scaling without apologies, Journal of Politics, forthcoming.
		
	Author: Tasos Kalandrakis


This file details calculations appearing in the Supplemental Appendix of the paper, specifically Tables A2 and A4.  


     
     Data

Survey data used in all calculations are included in the Matlab file GERN.mat and are sourced from the Comparative Study of Electoral Systems (2015, 2018). 
Additional data used in the calculations reported in Table A4 originate from Volkens et al. (2018) and Bakker let al. (2015) and are embedded in Matlab scripts TestMani.m and TestChapel.m (and are also reported in Table A3 of Online Appendix F).


     
     Duration of Replication Calculations

The calculations required to fully reproduce Table A4 take 5-8 minutes on a desktop machine.
Table A2 can be built in similar or less time using tests results previously computed by the author in a cluster environment using an average of approximately 120 cores.  These calculations took approximately four days and it is therefore not advisable to attempt to complete these calculations on a desktop machine.  Code to perform the computations on a cluster environment is also provided.  Contact the author for more efficient methods to replicate these calculations.


     Software Requirements 

Matlab is the only required software platform (the calculations have been verified in versions 2020a and later).


     
     Randomization Seed Setting

The computed tests rely on a bootstrap procedure.  Because the computations involved were distributed to multiple machines and workers where the state of the seed may not evolve in a predictable manner and to ensure replicability of the results, the randomization seed is set before the execution of each test on line 102 of ModTestTwoStep.m (with Matlab command rng(142536)).



     Warnings and Issues

No warnings or issues are encountered in the calculations reported in the main body of the paper.  Results in Tables A2 and A4 of the Online Appendix involve computation of the QLR version of the tests (version 2) which, as discussed in Online Appendix E, page 8, relies on a non-singularity condition that may not be verified and may cause numerical instability.  As a result, these QLR computations may trigger one of two warnings:
-- MATLAB:nearlySingularMatrix
-- MATLAB:singularMatrix
To expedite computation, the second of these warnings was turned off in the cluster computations (because the warning is printed in the corresponding log files, slowing down execution).  The first warning is also turned off for the QLR computations of the tests in Table A4.

     

     Detailed Replication Instructions

==>To fully replicate Table A4, open Matlab, make the folder SUPPLEMENTAL of this Dataverse your current folder and execute:

	ReplicateTableA4

in the command prompt.  This command will built 6 files that are stored in the folder /TESTRESULTS/ and then produces (using these results) Table A4 as a Matlab cell object that is displayed on screen in the Matlab variable window.  This Table was manually transferred into Latex by the author with the 2005 QLR and 2009 Chapel Hill QLR statistics omitted (as reported in the Online Appendix F).

==>To replicate Table A2 using test results computed by the author, open Matlab, make the folder SUPPLEMENTAL of this Dataverse your current folder and execute:

	ReplicateTableA2

in the command prompt.  This command produces Table A2 as a Matlab cell object that is displayed on screen in the Matlab variable window.  The Table was manually transferred into Latex by the author.


==>To fully replicate Table A2 in a cluster environment using the SLURM protocol (as performed by the author at the University of Rochester CIRC Bluehive cluster) first modify the following files (found in Dataverse folder SUPPLEMENTAL/CIRC/) which contain directory information that needs to be changed to the replicator's cluster directory:
	GerTestsRUF.sbatch
	GerTestsRU6.sbatch
	GerTestsF.sbatch
	GerTests6.sbatch  
	RunGerRUTestsFull.m
	RunGerRUTests6.m
	RunGerTestsFull.m
	RunGerTests6.m
The string "/scratch/akalandr/" in the above files has to be changed to "/REPDIR/" where REPDIR is the replicator's folder. 
Add two directories in /REPDIR/SUPPLEMENTAL/: 
	-- A folder /REPDIR/SUPPLEMENTAL/RESULTS and 
	-- a folder /REPDIR/SUPPLEMENTAL/LOG.  
Then copy the entire thus modified contents of Dataverse directory SUPPLEMENTAL (with all subfolders) in the above cluster /REDIR/ folder.  Open the cluster command prompt and change directory as in: 
	cd /REPDIR/SUPPLEMENTAL/CIRC/
Then execute (in sequence)
	sbatch GerTestsRUF.sbatch
	sbatch GerTestsRU6.sbatch
	sbatch GerTestsF.sbatch
	sbatch GerTests6.sbatch

These commands open Matlab and run all the tests.  Upon completion of these computations, transfer the 72 generated *.mat files from the cluster /REPDIR/SUPPLEMENTAL/RESULTS/ folder into the replicator's desktop /TESTRESULTS Dataverse folder. Open Matlab and make the Dataverse folder your Matlab current folder.  Then execute the command:
	ReplicateTableA2 
in the MATLAB prompt.  This command produces Table A2 as a Matlab cell object that is displayed on screen in the Matlab variable window.  The Table was manually transferred into Latex by the author.



     Detailed File Contents

The following files are included in the SUPPLEMENTAL folder of this Dataverse:
	1. READMESUPP.txt (this file)
	2. ReplicateTableA2.m (MATLAB script -- used to build Table A2 using previously computed test results)
	3. ReplicateTableA4.m (MATLAB script -- used to build Table A4 using previously computed test results)
	4. SUBFOLDER SUPPLEMENTAL/TestTwoStep
		-- ModTestTwoStep.m (MATLAB function -- performs two-step procedure of Romano et al. (2014).  Originally distributed by Michael Wolf and modified and redistributed with permission as detailed in the copyright notice at the beginning of the file).
		-- Smod.m (MATLAB function -- computes test statistic for two-step procedure of Romano et al. (2014). Originally distributed by Michael Wolf and modified and redistributed with permission as detailed in the copyright notice at the beginning of the file).
	5. SUBFOLDER SUPPLEMENTAL/Inference
		-- BMoment.m (MATLAB function -- evaluates moment function for (M_B)).
		-- RMoment.m (MATLAB function -- evaluates moment function for (M_R)).
		-- CMoment.m (MATLAB function -- evaluates moment function for (M_C)).
		-- BUMoment.m (MATLAB function -- evaluates moment function for (M_B) and (M_U)).
		-- RUMoment.m (MATLAB function -- evaluates moment function for (M_R) and (M_U)).
		-- H0B.m (MATLAB function -- runs tests of (M_B) or builds confidence set).
		-- H0R.m (MATLAB function -- runs tests of (M_R) or builds confidence set).
		-- H0BU.m (MATLAB function -- runs tests of (M_B) and (M_U) or builds confidence set).
		-- H0RU.m (MATLAB function -- runs tests of (M_R) and (M_U) or builds confidence set).
	6. SUBFOLDER SUPPLEMENTAL/Combined
		-- EstimationCS.m (MATLAB function -- computes count estimator (3) of the paper and (optionally) Confidence Sets for moment inequalities (M_B) and (M_R)).
	7. SUBFOLDER SUPPLEMENTAL/Tests
		-- TestManni.m (MATLAB function -- computes tests for Table A4).
		-- TestChapel.m (MATLAB script -- computes tests for Table A4).
	8. SUBFOLDER SUPPLEMENTAL/CIRC
		-- GerTestsRUF.sbatch (SLURM script -- calls RunGerRUTestsFull across versions and elections)
		-- GerTestsRU6.sbatch (SLURM script -- calls RunGerRUTests6 across versions and elections)
		-- GerTestsF.sbatch (SLURM script -- calls RunGerTestsFull across versions and elections)
		-- GerTests6.sbatch  (SLURM script -- calls RunGerTests6 across versions and elections)
		-- RunGerRUTestsFull.m (MATLAB script -- computes three versions of joint weak tests on all parties).
		-- RunGerRUTests6.m (MATLAB script -- computes three versions of joint weak tests on subset of six parties).
		-- RunGerTestsFull.m (MATLAB script -- computes count estimator and three versions of strong and weak tests on all parties).
		-- RunGerTests6.m (MATLAB script -- computes three versions of joint weak tests on subset of six parties).
		-- GERN.mat (contains survey data for the tests)
	9. SUBFOLDER TESTRESULTS (contains computation results files from the author for the tables in the Supplemental Appendix)
		a. 18 Matlab files that contain the results from running the count estimator, and tests of H^B and H^R on the full set of parties and file name syntax M*Fvj.mat where: 
			* is an election tag 98, a02, 05, 09, 13, 17
			j=1,2,3 for the three versions of the test statistic.
		b. 18 Matlab files that contain the results from running tests of H^RU on the full set of parties and file name syntax M*RUFvj.mat where: 
			* is an election tag 98, a02, 05, 09, 13, 17
			j=1,2,3 for the three versions of the test statistic.
		c. 18 Matlab files that contain the results from running the count estimator, and tests of H^B and H^R on the six common parties across elections and file name syntax M*6vj.mat where: 
			* is an election tag 98, a02, 05, 09, 13, 17
			j=1,2,3 for the three versions of the test statistic.
		d. 18 Matlab files that contain the results from running tests of H^RU on the six common parties across elections and file name syntax M*RU6vj.mat where: 
			* is an election tag 98, a02, 05, 09, 13, 17
			j=1,2,3 for the three versions of the test statistic.
		e. 6 Matlab files that contain results from running tests H^C for Table A4. File names have syntax ManiTestsj.mat and ChapelTestsj.mat where j=1,2,3. 
	10. FOlDER LOGFILES (contains log files from the last computation of results in the Supplemental Appendix by the author)
		a. 72 slurm log files with name syntax out.*-ij.out where 
			* is a 7 digit numerical code assigned by the slurm protocol to the corresponding computation
			i=1,2,3,4,5,6 for the six elections in the computations
			j=1,2,3 for the three versions of the test statistic
		b. 8 SLURM-generated e-mail files notifying initiation and completion of four (4) sbatch calculations (as per last author replication).
		


     License for Matlab Code

The code that is redistributed and originates in the distribution by Michael Wolf is covered by the original license as explicitly included in the corresponding code files.  All other code is licensed under a Creative Commons/CC-BY-NC license.
	


     References

Bakker, Ryan, Catherine de Vries, Erica Edwards, Liesbet Hoogte, Seth Jolly, Gary Marks, Jonathan Polk, Jan Rovny, Marco Steenbergen and Milalda Vachudova. 2015. "Measuring Party Positions in Europe: The Chapel Hill Expert Survey Trend File, 1999-2010." Party Politics 21(1):143-152.

Ronano, J. P., A. Shaikh and M. Wolf. 2014. "A practical two-step method for testing moment inequalities," Econometrica 82(5):1979-2002.

The Comparative Study of Electoral Systems. 2015, 2018. www.cses.org

Volkens, Andrea, Pola Lehmann, Theres, Matthiasse, Nicolas Merz, Sven Regel and Bernhard Wessels. 2018. "The Manifesto Data Collection. Manifesto Project (MRG/CMP/MARPOR). Berlin: Wissenschaftszentrum Berlin fur Sozialforschung (WZB)." Https:doi.org/10.25522/manifesto.mpds.2018a. 



